package com.example.tplus.mapper;

import com.example.tplus.bean.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

@Mapper
public interface BaoGongMapper {
    //查询员工信息
    public User getUser(String id);

    //查询工序信息
    public GXMX getGXName(QueryBaoGongBean queryBaoGongBean);

    //查询该工序是否在该订单里
    public List<String> isContainGXNumer(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean,@Param("gxNumber") String gxNumber);

    //查询物料编号
    public List<String> get物料编号(QueryBaoGongBean queryBaoGongBean);

    public String getGX最大可报数量(BaoGong baoGong);

    //查询加工顺序
    public String Get加工顺序(@Param("工序编号") String 工序编号, @Param("物料编号") String 物料编号);

    //查询工序单价
    public BigDecimal getPrice(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean,@Param("加工顺序") String 加工顺序);

    //查询上一道工序
    public String get上一道工序(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean,@Param("加工顺序") String 加工顺序);

    //上一道工序的报工数量
    public BigDecimal get上一道工序报工数量(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean, @Param("上一道工序") String 上一道工序);

    //累计报工数
    public BigDecimal get累计报工数(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean, @Param("加工顺序") String 加工顺序);

    //查询本工序订单数量
    public List<BigDecimal> get本工序订单数量(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean, @Param("物料编号") String 物料编号);

    //本工序累计报工数
    public BigDecimal get已报工数(@Param("queryBaoGongBean") QueryBaoGongBean queryBaoGongBean, @Param("加工顺序") String 加工顺序);

    //除成型减脚、成品编带，其它工序同一张单据单一员工号只允许报一次
    public int isInserted(@Param("生产订单号") String 生产订单号,@Param("生产订单行号") String 生产订单行号,@Param("报工人员") String 报工人员,@Param("工序名")String 工序名);

    //插入报工
    public int insertGX(InsertBaoGong insertBaoGong);


}
